UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uwISjyNVh5Qbwat0NYgWCDTUFtr/9rhOKEg6gtYRPPg='
WHERE
key_id = '50b03ab9d136feacd1162c2ded57da749e68208b2d2291e0fb5426ebbf9926ca'
AND (
token = 'uwISjyNVh5Qbwat0NYgWCDTUFtr/9rhOKEg6gtYRPPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)