UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DgvCyoYCamMAvoYrn7V3LQXDOd/eKg02zy+oPyaqm2M='
WHERE
key_id = '07a8bcf08c9a5f184c4ca8b9a111336ce749fadf280a9517ba528fe15dfa6329'
AND (
token = 'DgvCyoYCamMAvoYrn7V3LQXDOd/eKg02zy+oPyaqm2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)