UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GiSuUzctJhlcAgx9A4HqT5ohcGJnWAiE8QkiFUtPy3g='
WHERE
key_id = '4addb357d98e6012c2a763599e3ff201f429c6e4b7097072027febe69e6d2649'
AND (
token = 'GiSuUzctJhlcAgx9A4HqT5ohcGJnWAiE8QkiFUtPy3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)