UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qJjX66zpBIVLwnklE2tVt/q7XjVDj+EjOMqYVNHarj4='
WHERE
key_id = '5b8dc6628f192d611ac1f789cdc520d8796aae514a2c7979723057c2bad279df'
AND (
token = 'qJjX66zpBIVLwnklE2tVt/q7XjVDj+EjOMqYVNHarj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)