UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4RmfpiLL3cx7CSQhsWEpGJJ+Qj6865teUUX+Xn+bWJs='
WHERE
key_id = 'aad15358b8b81e6b920d86403a694715fc4d03a199b62631e68fe6daae47413e'
AND (
token = '4RmfpiLL3cx7CSQhsWEpGJJ+Qj6865teUUX+Xn+bWJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)