UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rdTDOVlxmsO7YSSRW/Sx3iNy/fkIw1MBmNthqp+4YsA=' 
WHERE 
  key_id = '3469394a5849b405405c78e6fd8eb21712d1cb8e31e972851bb15fd1deb67487' 
  AND (
    token = 'rdTDOVlxmsO7YSSRW/Sx3iNy/fkIw1MBmNthqp+4YsA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00142