UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LcUiLOnK039/VOXYFNYrZ2RtQ1uCorF4VRA3NHLH+Qc='
WHERE
key_id = 'a65816edabef9a752a7d309bbe37ec3a7c429d00b735cc784a23740e101af1d7'
AND (
token = 'LcUiLOnK039/VOXYFNYrZ2RtQ1uCorF4VRA3NHLH+Qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)