UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v1epLH0lvESM8DtI+wYZ0dqefVRXF2HZYc3tJd1XzEM='
WHERE
key_id = '04eeacdde652205e1dae4c70efede8663c93e6c1b57eb32ab389a3bdb9c95d18'
AND (
token = 'v1epLH0lvESM8DtI+wYZ0dqefVRXF2HZYc3tJd1XzEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)