UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YbLbKSNCyvK7yM/eJfs+sxY1J4hI2vW9QUdx7NiVoEk='
WHERE
key_id = '4c00ee2534dd9f160098255ff7bde7784ec3c166dfd0266a7d1d471850179b58'
AND (
token = 'YbLbKSNCyvK7yM/eJfs+sxY1J4hI2vW9QUdx7NiVoEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)