UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7vsnzU6A4fuZqtrLJL8BO34mi4SMfuIppk15bPTktkw=' 
WHERE 
  key_id = 'b64cc963eba79a277e7ba871af0a815154db61b8c6c1e0cab66d4c0d246eecc8' 
  AND (
    token = '7vsnzU6A4fuZqtrLJL8BO34mi4SMfuIppk15bPTktkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049