UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DJRUOqRJAUedH5gQg5k3gOPlr+tTEVNxVJHvnLLMYKo='
WHERE
key_id = '4649c96204cf0e165bb9d616e94a7dbe7a422dd788ed56f6bb446057ff8a845f'
AND (
token = 'DJRUOqRJAUedH5gQg5k3gOPlr+tTEVNxVJHvnLLMYKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)