UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EjMD8/h4U1CG4+edyeRuUzBojXr5ydSX2SRU6tqOX8g='
WHERE
key_id = 'cee59568a5b19b048b6c80866e6a49514531f1d5b9f631358b5045f6bb608a41'
AND (
token = 'EjMD8/h4U1CG4+edyeRuUzBojXr5ydSX2SRU6tqOX8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)