UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tVFaEdLGMIW8t8kXUBDHvjtRXnz/mZjo9zvpiCpsTCQ='
WHERE
key_id = '959085a0b97c905e6c52183189538a4e702600a90afc73c738e8f8ffa84f8fb2'
AND (
token = 'tVFaEdLGMIW8t8kXUBDHvjtRXnz/mZjo9zvpiCpsTCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)