UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pRhpuSuEGqIuhKZWTsTnsydJ8eldcUCjVHc3o5UeHxI='
WHERE
key_id = '496f86599a8ed4e36b544b850d66b16fe3ee5b9324ffca19a17bbb03d1f80a6a'
AND (
token = 'pRhpuSuEGqIuhKZWTsTnsydJ8eldcUCjVHc3o5UeHxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)