UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j23TM5xeCgJmkkejEQx6Nzu7o0ISGLJOb/jubcgFPsM='
WHERE
key_id = '6c1b4139cb2b80fa1327bf77e4e89c30cf8bee6675ef69b1b2f406425e844ddb'
AND (
token = 'j23TM5xeCgJmkkejEQx6Nzu7o0ISGLJOb/jubcgFPsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)