UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/B25SqzJ4uf/EkenGe1tO2MlJXA6SdnP2nG0QpJn77A='
WHERE
key_id = 'a39e4e9de19bf7bcc48e1025b96b2b680c7b315e63e72509ddcb0426203b3192'
AND (
token = '/B25SqzJ4uf/EkenGe1tO2MlJXA6SdnP2nG0QpJn77A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)