UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dZVK9mhzCeEk55Uq29QmoG+mOwFJa+MV07Dqnvpym9k=' 
WHERE 
  key_id = '03f7044ca63e9ff0ccc26d59081f2e664c0717d7f118e6ca925050e3ad22ac39' 
  AND (
    token = 'dZVK9mhzCeEk55Uq29QmoG+mOwFJa+MV07Dqnvpym9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041