UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0L53v2LcLNWIiSGfpUycZPeeb9sXnSyGZhFMKi+qOVo='
WHERE
key_id = 'e89113f1849bb5454e0e229e7a20532ffbc14276e69887143a69d228556a90c5'
AND (
token = '0L53v2LcLNWIiSGfpUycZPeeb9sXnSyGZhFMKi+qOVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)