UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '11zoF5YA2QekzSrlya8HFuvQRx1CHYiEm7gEGhBxYbs=' 
WHERE 
  key_id = 'e28dea4135b1b879b4d24f644c46d6d31f4435b37fb5b74c26f0ee661c2e1087' 
  AND (
    token = '11zoF5YA2QekzSrlya8HFuvQRx1CHYiEm7gEGhBxYbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037