UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'km/m1Ep/jbhRCIxsBLCSUwGc3aChPHhEPWmOJiYdLBQ='
WHERE
key_id = '0121ee40fb9006005d9835e5977fd95c6783f2d36df07a9e368afc85b4634bec'
AND (
token = 'km/m1Ep/jbhRCIxsBLCSUwGc3aChPHhEPWmOJiYdLBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)