UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ms1KPWZTH3bTAZJetSdluZGh4Q5KckNEHqjE5ks6Pn4=' 
WHERE 
  key_id = 'a0868c5281f39a2abc084ed2eabcd045e25ad1eb6bbda2987e425b69c97b559e' 
  AND (
    token = 'Ms1KPWZTH3bTAZJetSdluZGh4Q5KckNEHqjE5ks6Pn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047