UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FXk9zW3Smsgrn216NWWR6TkZQ6Un7/obf0VPH7ByX58='
WHERE
key_id = '15616bbb3461f521e25b719dbab31ffb67e8d32a69a63f3af91be476729a4691'
AND (
token = 'FXk9zW3Smsgrn216NWWR6TkZQ6Un7/obf0VPH7ByX58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)