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