UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f/NeYlCdk9HVADc3VuUYV0S9UaTK3NiqtysxKZWGEr0='
WHERE
key_id = '4e4c4dd503756559de96bc84577ede2d60b0d2bcab1998afc88873cb6495b72b'
AND (
token = 'f/NeYlCdk9HVADc3VuUYV0S9UaTK3NiqtysxKZWGEr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)