UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PNuxxf3l6dpXjfq3N1jHoQyDD+z7nGS1gfuyiovCSiQ=' 
WHERE 
  key_id = '9f02ac825ae374a2b841369295e86af37eddd2ff5f4fb5065ba6ba7c39665c94' 
  AND (
    token = 'PNuxxf3l6dpXjfq3N1jHoQyDD+z7nGS1gfuyiovCSiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031