UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2DzipLUb1FfeSo0VbONAPdsRTavxB0CU8FGevT8fXLw='
WHERE
key_id = '18f4f534fa27474b7f382a5c1e451fad28f64994e250f0e6fc2a3b37a8b78cf3'
AND (
token = '2DzipLUb1FfeSo0VbONAPdsRTavxB0CU8FGevT8fXLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)