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