UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GyESk0LJQPMBF5Kxo0qm24XQw9UeiwOnocNixDUrP5o=' 
WHERE 
  key_id = '234d37a0fea468e5b16641288ca875320fd389f1511b702bdab00f60c6c402ea' 
  AND (
    token = 'GyESk0LJQPMBF5Kxo0qm24XQw9UeiwOnocNixDUrP5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023