UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YdO8I/GZImUl9EaeB/WBJYAMD1pARRmj7Fk4qgnTI5U='
WHERE
key_id = 'e6cffa4219b5d01989160e0a63929fd18b687658a354e9cd255012d8865cb7fb'
AND (
token = 'YdO8I/GZImUl9EaeB/WBJYAMD1pARRmj7Fk4qgnTI5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)