UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wLeDp1cRJsq2z+qpfK2NZKwpdspmsIkqwDiXTxk86OA='
WHERE
key_id = 'd60add43607f57efb363f9fe7ed2d910b77abffa08a7bc1b9e95d96897d0c9cd'
AND (
token = 'wLeDp1cRJsq2z+qpfK2NZKwpdspmsIkqwDiXTxk86OA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)