UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YZBAtcL8kmUuBvEyGpA+kJs3P/7eWFjFs/D2fHVR1WA='
WHERE
key_id = 'dc2c1be15b00801643a82f9599439f020534f31c75fc18c2c134f70007fb2e8d'
AND (
token = 'YZBAtcL8kmUuBvEyGpA+kJs3P/7eWFjFs/D2fHVR1WA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)