UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XcZcTwgcA/tzwPh2RTtUXIMJEDr4g2rVPscD23p86vg='
WHERE
key_id = 'aa93d8871323d392e4a555cb90cd245e6bab5143de4e325fa5b7965fae24720c'
AND (
token = 'XcZcTwgcA/tzwPh2RTtUXIMJEDr4g2rVPscD23p86vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)