UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Osq71HEQd02yRF9ot5pyhQke7oZtp4fmnUJUKfwX6/Y=' 
WHERE 
  key_id = 'a420f0090dd8205d0e0c4c86d4e00c614f6289001d65a6b9e8fdb0be5566a998' 
  AND (
    token = 'Osq71HEQd02yRF9ot5pyhQke7oZtp4fmnUJUKfwX6/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022