UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kIqfzURYeanRFyi19HvFRIFHv+wsbBPEoDRRcOAomGo='
WHERE
key_id = '560361314246a9a34485f02c125b9fb24fc00f1a9c03297015c86007d72fc010'
AND (
token = 'kIqfzURYeanRFyi19HvFRIFHv+wsbBPEoDRRcOAomGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)