UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QlUelVjqkU2ljd7nd9oTiwjLgNo+7hdicecaKLnCX+I=' 
WHERE 
  key_id = 'ccc26bf6a8f37d43bfbdb786883312635201b3ecb75d5900017ee4bc6c68ed13' 
  AND (
    token = 'QlUelVjqkU2ljd7nd9oTiwjLgNo+7hdicecaKLnCX+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034