UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Y+MH7yCvVaFM7+QrrtTwRJKiTgyB1XpFMOC3OsIe5k='
WHERE
key_id = '9bf4fe7523e937e9ee1cf49df8b8b982226dba55d11cca872e8a287c017004df'
AND (
token = '1Y+MH7yCvVaFM7+QrrtTwRJKiTgyB1XpFMOC3OsIe5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)