UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5GYMcMRzPlXc35BpJNfRu7w2l5GrN5XpphKXz6SztlI=' 
WHERE 
  key_id = '48fc92d6e6fc856132469b84414a71ad79a7a799d34e62423e357e77826f23fd' 
  AND (
    token = '5GYMcMRzPlXc35BpJNfRu7w2l5GrN5XpphKXz6SztlI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035