UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yl4UJ7xlOeCu9SXJf1GY7uL/y1JaMWK9eW7TiM6z0S8='
WHERE
key_id = 'de61130c01431d1573045409e606984f90dde86e4df3de98e848e40a3e745966'
AND (
token = 'yl4UJ7xlOeCu9SXJf1GY7uL/y1JaMWK9eW7TiM6z0S8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)