UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yB2w6Oji2X7l1j1Nr9qUaEIxtXDzkgBZXuBxiD0XOSI=' 
WHERE 
  key_id = 'ad01f6982470451df435f4ba972da9e353c4d34563b3130e21fd9a01936fe8bd' 
  AND (
    token = 'yB2w6Oji2X7l1j1Nr9qUaEIxtXDzkgBZXuBxiD0XOSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055