UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rsj6fFiDnOY3UnVaJkUFFfJOSHS6iwhJ0M0pBmz9lOE='
WHERE
key_id = 'f24e7ca5d8e2c6430bee007f0b940c56555e25036f5652a831912aa1bd321062'
AND (
token = 'Rsj6fFiDnOY3UnVaJkUFFfJOSHS6iwhJ0M0pBmz9lOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)